package com.design;

/**
 * 已取消
 */
public class CannelOrder implements OrderState{
    @Override
    public void pay(Order order) {
        System.out.println("已取消状态的订单无法支付");
    }

    @Override
    public void cancel(Order order) {
        System.out.println("订单已取消");
        order.setOrderState(new CannelOrder());
    }

    @Override
    public void ship(Order order) {
        System.out.println("已取消状态的订单无法发货");
    }

    @Override
    public void receive(Order order) {
        System.out.println("已取消状态的订单无法收货");
    }

    @Override
    public String getStateName() {
        return "已取消";
    }
}
